package com.example.javabasic.thread.classone.demo5;

/**
 * 线程组
 */
public class ThreadGroupTest {
    public static void main(String[] args) {
        //根据名称创建
        ThreadGroup group = new ThreadGroup("testGroup");

        Thread thread = new Thread(group,()->{
            System.out.println("xiancehng");
        },"name");
        ThreadGroup threadGroup = thread.getThreadGroup();
        System.out.println(threadGroup.getName());
        System.out.println(threadGroup.getParent().getName());

    }
}
